﻿//璇惧悗璇勪环
var timeBao_feed = function () {
    var temp_loop_index = 0;
    temp_loop_index = setInterval(function () {
        var liHeight = $("#feed").find("li:first").height();
        $("#feed").animate({ marginTop: "-" + liHeight + "px" }, 1000, function () {
            $("#feed").find("li:first").appendTo($("#feed"))
            $("#feed").find("li:first").hide();
            $("#feed").css({ marginTop: 0 });
            $("#feed").find("li:first").show();
        });
    }, 5000);
    return temp_loop_index;
}
//瀛﹀憳蹇冨０
var timeBao_stu = function () {
    var temp_loop_index = 0;
    temp_loop_index = setInterval(function () {
        var liHeight = $("#stu").find("li:first").height();
        $("#stu").animate({ marginTop: "-" + liHeight + "px" }, 1000, function () {
            $("#stu").find("li:first").appendTo($("#stu"))
            $("#stu").find("li:first").hide();
            $("#stu").css({ marginTop: 0 });
            $("#stu").find("li:first").show();
        });
    }, 5000);
    return temp_loop_index;
}

//瀛﹀憳蹇冨０
var timeBao_stu_1 = function () {
    var temp_loop_index = 0;
    temp_loop_index = setInterval(function () {
        var liHeight = $("#stu_1").find("li:first").height();
        $("#stu_1").animate({ marginTop: "-" + liHeight + "px" }, 1000, function () {
            $("#stu_1").find("li:first").appendTo($("#stu_1"))
            $("#stu_1").find("li:first").hide();
            $("#stu_1").css({ marginTop: 0 });
            $("#stu_1").find("li:first").show();
        });
    }, 5000);
    return temp_loop_index;
}

$(document).ready(function () {
    //璇惧悗璇勪环	
    var scrtime_feed = timeBao_feed();
    $("#feed").hover(
		function () {
		    clearInterval(scrtime_feed);
		},
		function () {
		    scrtime_feed = timeBao_feed();
		}
	);
    //瀛﹀憳蹇冨０	
    var scrtime_stu = timeBao_stu();
    $("#stu").hover(
		function () {
		    clearInterval(scrtime_stu);
		},
		function () {
		    scrtime_stu = timeBao_stu();
		}
	);
    //婊戝潡缂撳姩
    //绗竴缁�
    $("#why_bta").hover(function () {
        $("#why_a").find("div").show();
        $("#why_a div.a1").animate({ left: "246px" }, "slow");
        $("#why_a div.a2").animate({ left: "492px" }, "slow");
        $("#why_a div.a3").animate({ left: "738px" }, "slow");
    });
    $("#why_a").mouseleave(function () {
        $(this).find("div").hide();
        $("#why_a div.a1").animate({ left: "0px" });
        $("#why_a div.a2").animate({ left: "0px" });
        $("#why_a div.a3").animate({ left: "0px" });
    })
    //绗簩缁�	
    $("#why_btb").hover(function () {
        $("#why_b").find("div").show();
        $("#why_b div.b1").animate({ left: "0px" }, "slow");
        $("#why_b div.b2").animate({ left: "492px" }, "slow");
        $("#why_b div.b3").animate({ left: "738px" }, "slow");
    });
    $("#why_b").mouseleave(function () {
        $(this).find("div").hide();
        $("#why_b div.b1").animate({ left: "246px" });
        $("#why_b div.b2").animate({ left: "246px" });
        $("#why_b div.b3").animate({ left: "246px" });
    })
    //绗笁缁�	
    $("#why_btc").hover(function () {
        $("#why_c").find("div").show();
        $("#why_c div.c1").animate({ left: "0px" }, "slow");
        $("#why_c div.c2").animate({ left: "246px" }, "slow");
        $("#why_c div.c3").animate({ left: "738px" }, "slow");
    });
    $("#why_c").mouseleave(function () {
        $(this).find("div").hide();
        $("#why_c div.c1").animate({ left: "492px" });
        $("#why_c div.c2").animate({ left: "492px" });
        $("#why_c div.c3").animate({ left: "492px" });
    })
    //绗洓缁�	
    $("#why_btd").hover(function () {
        $("#why_d").find("div").show();
        $("#why_d div.d1").animate({ left: "0px" }, "slow");
        $("#why_d div.d2").animate({ left: "246px" }, "slow");
        $("#why_d div.d3").animate({ left: "492px" }, "slow");
    });
    $("#why_d").mouseleave(function () {
        $(this).find("div").hide();
        $("#why_d div.d1").animate({ left: "738px" });
        $("#why_d div.d2").animate({ left: "738px" });
        $("#why_d div.d3").animate({ left: "738px" });
    })

    //璇剧▼鑳屾櫙杞崲
    $(".pic_kc li:even").addClass("even");

    //鍙嬫儏閾炬帴	
    $("#link").xslider({
        unitdisplayed: 3,
        movelength: 3,
        unitlen: 303,
        autoscroll: null
    });
    //浼樼澶栨暀鐨勬樉绀哄垏鎹�
    $("#teach").click(function () {
        

        var indexofnum = parseInt($(this).attr('good'));
        var next_indexofnum = indexofnum + 1;
        if (indexofnum == 2) {
            next_indexofnum = 1;
        }
        $("#teach" + indexofnum).hide();
        $("#teach" + next_indexofnum).show();

        $(this).attr('good', next_indexofnum);

    });

});